package park;

public class J12Fan {

	public static void main(String[] args) {
		
		Fan yfan = new Fan();
		yfan.radius = 10;
		yfan.color = "yellow";
		yfan.speed = yfan.FAST; // 주의! 객체 이름.상수
		yfan.on = true;
		System.out.println(yfan.toString());
		
		
		Fan bfan = new Fan();
		bfan.radius = 5;
		bfan.color = "blue";
		bfan.speed = bfan.MEDIUM;
		bfan.on = false;
		System.out.println(bfan.toString());

	}//메인

}//클래스

class Fan{
	
	final int SLOW = 1;
	final int MEDIUM = 2;
	final int FAST = 3;
	int speed = SLOW;
	boolean on = false;
	double radius = 5.0;
	String color = "blue";
	
	@Override //부모클래스에서 정의된 메서드를 자손클래스에서 다시 정의함
	public String toString() {
		String result = "";
		
		if(on == true){
		result += speed + "/" + color + "/" + radius + "/" + "작동중";
		
		}else{
		result += speed + "/" + color + "/" + radius + "/" + "정지";
			
	}
	
		return result;
		
	}
}